package com.ym.student.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ym.student.system.entity.SysRole;
import com.ym.student.system.entity.SysUserRole;
import com.ym.student.system.mapper.SysRoleMapper;
import com.ym.student.system.service.ISysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ym.student.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ym
 * @since 2025-04-02
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

    SysRoleMapper sysRoleMapper;
    @Autowired
    ISysUserService sysUserService;


    @Override
    public Page<SysRole> queryPage(Page<SysRole> page, String roleName) {
        LambdaQueryWrapper<SysRole> queryWrapper = new LambdaQueryWrapper<SysRole>();
        if (StringUtils.isNotBlank(roleName)){
            queryWrapper.like(SysRole::getRoleName,roleName);

        }
        return  this.page(page, queryWrapper);
    }
}
